<template>
  <div class="friends" v-if="friendList && friendList.length">
    <div class="friends-content" v-for="(item, index) in friendList">
      <img :src="item.friend_info.avatar" />
      <div class="friends-content-info">
        <span>{{ item.friend_info.nickname }}</span>
        <span>{{ `(${item.friend_info.username})` }}</span>
      </div>
      <span class="friends-content-btn">发消息</span>
    </div>
  </div>
</template>

<script setup lang="ts">
const props = defineProps({
  friendList: {
    type: Array as any
  }
})
</script>

<style scoped lang="less">
.friends {
  &-content {
    padding: 10px 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    position: relative;

    >img {
      width: 80px;
      height: 80px;
      border-radius: 50%;
    }

    &-info {
      >span {
        margin-left: 20px;
        display: block;
      }
    }

    &-btn {
      position: absolute;
      right: 20px;
      padding: 10px 20px;
      border-radius: 20px;
      background-color: #ffffff;
    }
  }
}
</style>